<template>
  <div>
      <van-field label='标题' v-model="form.name"/>
      <van-button @click="addglist">发布</van-button>
  </div>
</template>

<script>
// import axios from 'axios'
import myaxios from 'axios'
export default {
data(){
    return{
        form:{'userid':localStorage.getItem('id')}
    }
},
methods:{
    addglist(){
        myaxios({url:'http://127.0.0.1:5000/newsM',method:'post',data:this.form}).then(res=>{
            console.log(res)
            this.$toast.fail("发布成功");
        })
    }
    
},
mounted() {

    }
}
</script>

<style>

</style>